import request from '@/utils/request'

// export default {
//     //1 講師列表（條件查詢分頁)
//     //current:當前頁 limit:每頁記錄數 teacherQuery:條件對象
//     getList(current,limit,teacherQuery){
//         return request({
//             //url: '/table/list/' + current + '/' + limit,
//             url:`/eduservice/teacher/pagingTeacherCondition/${current}/${limit}`,
//             method: 'post',
//             //params teacherQuery:條件對象, 後端使用 RequestBoy 獲取數據
//             //data 表示把對象轉換成 json 經行傳遞到接口裏面
//             data: teacherQuery
//           })
//     }
// }

export function getList(current,limit,teacherQuery) {
    return request({
            url:`/eduservice/teacher/pagingTeacherCondition/${current}/${limit}`,
            method: 'post',
            data: teacherQuery
    })
}

export function deleteTeacherId(id) {
    return request({
            url:`/eduservice/teacher/${id}`,
            method: 'delete'
    })
}

export function addTeacherId(teacher) {
        return request({
                url:`/eduservice/teacher/addTeacher`,
                method: 'post',
                data: teacher
        })
}

export function getTeacherInfo(id) {
        return request({
                url:`/eduservice/teacher/getTeacher/${id}`,
                method: 'get'
        })
}

export function updateTeacher(teacher) {
        return request({
                url:`/eduservice/teacher/udpateTeacher`,
                method: 'post',
                data: teacher
        })
}
